package com.bana.sys.model;

import com.bana.sys.utils.Convert;

import java.util.ArrayList;
import java.util.List;

/**
 * 角色
 */
public class Role {

    //数据库字段
    private int jsbm;
    private String jsmc;
    private String jsms;

    //扩展字段
    private List<Function> functions;


    //以下方法并不是默认的

    public String getFunctionssm() {
        if(this.functions==null)
        {
            return "";
        }
        else
        {
            List<String> list=new ArrayList<>();
            for(Function function:this.functions)
            {
                list.add(function.getGnmc());
            }
            return Convert.toString(list);
        }
    }
    //end

    public List<Function> getFunctions() {
        return functions;
    }

    public void setFunctions(List<Function> functions) {
        this.functions = functions;
    }

    public int getJsbm() {
        return jsbm;
    }

    public void setJsbm(int jsbm) {
        this.jsbm = jsbm;
    }

    public String getJsmc() {
        return jsmc;
    }

    public void setJsmc(String jsmc) {
        this.jsmc = jsmc;
    }

    public String getJsms() {
        return jsms;
    }

    public void setJsms(String jsms) {
        this.jsms = jsms;
    }

}